package com.winderinfo.yikaotianxia.ui.classification;

import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.winderinfo.yikaotianxia.R;
import com.winderinfo.yikaotianxia.core.base.BaselanFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class FragmentText extends BaselanFragment {

    @BindView(R.id.fen_tab)
    TabLayout fenTab;
    @BindView(R.id.fen_page)
    ViewPager fenPage;
    private List<String> tabList;

    @Override
    protected int layoutResID() {
        return R.layout.item_fragment_fenlei;
    }

    @Override
    protected void initView(View view) {
        //TabLayout标题
        tabList = new ArrayList<>();
        tabList.add("班型");
        tabList.add("课程");
        tabList.add("教材");

    }

    @Override
    protected void loadData() {
        //专业ID
        int position = getArguments().getInt("position");
        //设置适配器
        fenPage.setAdapter(new ListPagerAdapter(getChildFragmentManager(), tabList, position));
        fenTab.setupWithViewPager(fenPage);
    }

}
